export const questionnaireTypeOptions = [
  { label: '基础信息收集表', value: 1 },
  // { label: '自评估清单', value: 2 },
  // { label: '资产清单', value: 3 },
];

export const questionnaireStatusOptions = [
  { label: '未发布', value: 0 },
  { label: '已发布', value: 1 },
  { label: '已废除', value: 2 },
];

export const taskStatusOptions = [
  { label: '未开始', value: 1 },
  { label: '进行中', value: 2 },
  { label: '已完成', value: 3 },
];

export const fillStatusOptions = [
  { label: '未开始', value: 1 },
  { label: '进行中', value: 2 },
  { label: '已完成', value: 3 },
];

export const taskTypeOptions = [
  { label: '单任务', value: 1 },
  { label: '任务组', value: 2 },
];

export const getLabelByValue = (value, options, defaultLabel) => {
  const theOne = options.find((item) => String(item.value) === String(value));
  return theOne ? theOne.label : defaultLabel || value;
};
